From 72dc88988508d64b1814b2fd5bf842ed737c9b7c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 29 Jan 2008 09:36:37 +0000 Subject: [PATCH] x86: Fix 16889:60bb765b25b5 in a couple of respects: 1. Leave bottom-most 1MB permanently mapped. 2. ACPI-table mapping code shoudl be aware that mappings above 1MB of non-RAM are not permanent. Signed-off-by: Keir Fraser --- xen/arch/x86/acpi/boot.c | 3 ++- xen/arch/x86/mm.c | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c index 7db32263c1..24939059fb 100644 --- a/xen/arch/x86/acpi/boot.c +++ b/xen/arch/x86/acpi/boot.c @@ -110,7 +110,8 @@ char *__acpi_map_table(unsigned long phys, unsigned long size) unsigned long base, offset, mapped_size; int idx; - if (phys + size < 8 * 1024 * 1024) + /* XEN: RAM holes above 1MB are not permanently mapped. */ + if (phys + size < 1 * 1024 * 1024) return __va(phys); offset = phys & (PAGE_SIZE - 1); diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 0b59d7a3c2..0b0e8c1d94 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -207,7 +207,7 @@ void __init arch_init_memory(void) { extern void subarch_init_memory(void); - unsigned long i, pfn, rstart_pfn, rend_pfn, ioend_pfn; + unsigned long i, pfn, rstart_pfn, rend_pfn, iostart_pfn, ioend_pfn; /* * Initialise our DOMID_XEN domain. @@ -252,17 +252,18 @@ void __init arch_init_memory(void) } /* - * Make sure any Xen mappings are blown away. + * Make sure any Xen mappings of RAM holes above 1MB are blown away. * In particular this ensures that RAM holes are respected even in - * the statically-initialised 0-16MB mapping area. + * the statically-initialised 1-16MB mapping area. */ + iostart_pfn = max_t(unsigned long, pfn, 1UL << (20 - PAGE_SHIFT)); ioend_pfn = rstart_pfn; #if defined(CONFIG_X86_32) ioend_pfn = min_t(unsigned long, ioend_pfn, DIRECTMAP_MBYTES << (20 - PAGE_SHIFT)); #endif - if ( pfn < ioend_pfn ) - destroy_xen_mappings((unsigned long)mfn_to_virt(pfn), + if ( iostart_pfn < ioend_pfn ) + destroy_xen_mappings((unsigned long)mfn_to_virt(iostart_pfn), (unsigned long)mfn_to_virt(ioend_pfn)); /* Mark as I/O up to next RAM region. */ -- 2.30.2